

clear
set more off
cd "/Users/michaelflynn/Dropbox/Projects/Aid and NGOs/Data"
use "ngoaiddata.dta", clear

log using ngosandaidappendix, smcl name(ngosandaidappendix) replace

* Variable Labels
	label var logexport "ln(Exports)"
	label var percright "Percentage of Right Parties"
	label var exports_percent "Exports as $\%$ of Donor GDP"
	label var post08 "Post-Financial Crisis"
	label var growth "Donor Growth Rate"
	label var polity2 "Recipient Polity Score"
	label var physint "Recipient Physical Integrity Rights"
	label var lndisasternum2l "Natural Disasters"
	label var defense "Alliance"
	label var s3un "UN Affinity"
	label var lnall "ln(All Aid Channels)"
	label var govtrile "Donor Government Ideology Score"
	label var govtecon "Donor Government Ideology Score"
	label var lnratio "Lagged ln(Aid Ratio)"
	label var prio2 "Recipient Civil Conflict"
	label var lnngo "ln(NGO Aid)"
	label var lnpublic "ln(Public Aid)"
	label var loggdppc "Recipient GDP Per Capita"
	label var governance_all_mean "Recipient Governance"

* Alternative DVs for robustness checks
	replace percngo = (ngosandcivilsociety/allchannels)*100
	replace ngoovergov = ngosandcivilsociety/(ngosandcivilsociety+publicsector)


set matsize 2000
replace dyad = (ccode1*1000)+ccode2
drop if dyad==.
xtset dyad year

* Ratio Models
eststo clear
reg F.lnratio govtrile socgdp1Ml  growth post08 s3un defense physint polity2 prio2 lnall exports_percent loggdppc governance_all_mean colony lnratio, robust
/// Model 1 - Base Model
eststo: reg F.lnratio govtrile if e(sample), robust
/// Model 2 - Full Model
eststo: reg F.lnratio govtrile socgdp1Ml  growth s3un defense physint polity2 prio2 lnall exports_percent loggdppc governance_all_mean colony lnratio, robust
/// Model 3 - Full model with  random effects
eststo: xtreg F.lnratio govtrile socgdp1Ml  growth s3un defense physint polity2 prio2 lnall exports_percent loggdppc governance_all_mean colony lnratio , re robust

#delimit ;
	
esttab est1 est2 est3 using table_A1.tex, replace	
		se(3)
		b(3) 
		star(* .10 ** .05 *** .01) 
		wide
		substitute(  )
		nogaps
		order(govtrile  socgdp1Ml growth s3un defense exports_percent colony polity2 loggdppc governance_all_mean prio2 physint lnratio)
		compress
		label 
		nonotes
		mtitles("Base Model" "OLS Model" "Random Effects")  
		addnote("Robust standard errors in parentheses." "$*$ p$\leq$ 0.10 $**$ p$\leq$ 0.05, $***$ p$\leq$0.01")
		;		
		#delimi cr
		
		


* Seemingly Unrelated Regression Models		
eststo clear
set matsize 2000
xtset dyad year
/// Model 1 - No Fixed Effects
eststo: sureg (F.lnngo lnngo  growth post08 govtrile  colony s3un defense prio2  polity2 governance_all_mean loggdppc socgdp1Ml exports_percent physint lnall ) ///
			  (F.lnpublic lnpublic  growth post08 govtrile  colony s3un defense prio2  polity2 governance_all_mean loggdppc socgdp1Ml exports_percent physint lnall ) , corr

/// Model 2 - Fixed Effects
eststo: sureg (F.lnngo lnngo growth post08 govtrile  colony s3un defense prio2 polity2 governance_all_mean loggdppc socgdp1Ml exports_percent physint lnall i.ccode2) ///
		      (F.lnpublic lnpublic   growth post08 govtrile  colony s3un defense prio2  polity2 governance_all_mean loggdppc socgdp1Ml exports_percent physint lnall i.ccode2), corr

			  #delimit ;
	
esttab est1 est2 using table_A2.tex, replace	
		se(3)
		b(3) 
		star(* .10 ** .05 *** .01) 
		wide
		nogaps
		mtitles
		scalars("chi2_bp $\chi^2$" )
		compress
		keep(govtrile  socgdp1Ml growth s3un defense exports_percent colony polity2 governance_all_mean prio2 physint loggdppc lnall lnngo lnpublic)
		order(govtrile  socgdp1Ml growth s3un defense exports_percent colony polity2 governance_all_mean prio2 physint loggdppc lnall lnngo lnpublic)
		label 
		nonotes
		equations(1,2)
		mtitles("No Fixed Effects" "Recipient FE")
		eqlabels("\emph{NGO Aid Equation}" "\emph{Public Sector Aid Equation}")
		addnote("Standard errors in parentheses." "$*$ p$\leq$ 0.10 $**$ p$\leq$ 0.05, $***$ p$\leq$0.01")
		;		
		#delimit cr
		
		
	
/// Ratio Models with Conditional Effects and Overall Ideology Measure
gen gov_def = govtrile*defense
label var gov_def "Donor Government Ideology Score $\times$ Alliance"

eststo clear
/// Model 1 - Exports
eststo: xtreg F.lnratio c.govtrile##c.exports_percent socgdp1Ml growth post08 s3un defense physint polity2 loggdppc governance_all_mean prio2 lnall colony lnratio, re robust
/// Model 2 - Affinity
eststo: xtreg F.lnratio c.govtrile##c.s3un socgdp1Ml growth post08 defense physint polity2 loggdppc governance_all_mean prio2 lnall c.exports_percent colony lnratio, re robust
/// Model 3 - Defense
eststo: xtreg F.lnratio c.govtrile defense gov_defense2 socgdp1Ml growth post08 s3un physint polity2 loggdppc governance_all_mean prio2 lnall c.exports_percent colony lnratio, re robust
/// Model 4 - Governance
eststo: xtreg F.lnratio c.govtrile##c.governance_all_mean socgdp1Ml growth post08 s3un defense physint polity2 loggdppc prio2 lnall c.exports_percent colony lnratio, re robust
/// Model 5 - Physical Integrity Rights
eststo: xtreg F.lnratio c.govtrile##c.physint socgdp1Ml growth post08 s3un defense polity2 loggdppc governance_all_mean prio2 lnall c.exports_percent colony lnratio, re robust
/// Model 6 - Development
eststo: xtreg F.lnratio c.govtrile##c.loggdppc socgdp1Ml growth post08 s3un defense physint polity2 governance_all_mean prio2 lnall c.exports_percent colony lnratio, re robust

#delimit ;
	
esttab est1 est2 est3 est4 est5 est6 using table_A3.tex, replace	
		se(3)
		b(3) 
		star(* .10 ** .05 *** .01) 
		wide
		substitute(  )
		nogaps
		nobaselevels
		noomitted
		compress
		label 
		nonotes
		mtitles("Exports" "Affinity" "Alliance" "Governance" "Human Rights" "Development") 
		order(govtrile exports_percent s3un defense governance_all_mean physint loggdppc c.govtrile#c.exports_percent c.govtrile#c.s3un gov_defense2 c.govtrile#c.governance_all_mean c.govtrile#c.physint c.govtrile#c.loggdppc socgdp1Ml growth colony polity2 prio2 post08 lnall lnratio)
		addnote("Robust standard errors in parentheses." "$*$ p$\leq$ 0.10 $**$ p$\leq$ 0.05, $***$ p$\leq$0.01")
		;		
		#delimi cr
		
		
* Ratio Models w/ year fixed effects & economic right-left measure
eststo clear
reg F.lnratio govtecon socgdp1Ml  growth post08 s3un defense physint polity2 loggdppc governance_all_mean prio2 lnall exports_percent colony lnratio, robust
/// Model 1 - Base Model
eststo: reg F.lnratio govtecon if e(sample), robust
/// Model 2 - Full Model
eststo: reg F.lnratio govtecon socgdp1Ml  growth post08 s3un defense physint polity2 loggdppc governance_all_mean prio2 lnall exports_percent colony i.year if e(sample), robust
/// Model 3 - Full model with  random effects
eststo: xtreg F.lnratio govtecon socgdp1Ml  growth post08 s3un defense physint polity2 loggdppc governance_all_mean prio2 lnall exports_percent colony i.year if e(sample), re robust

#delimit ;
	
esttab est1 est2 est3 using table_A4.tex, replace	
		se(3)
		b(3) 
		star(* .10 ** .05 *** .01) 
		wide
		substitute(  )
		nogaps
		keep(govtecon  socgdp1Ml s3un defense exports_percent colony polity2 loggdppc governance_all_mean prio2 physint growth)
		order(govtecon  socgdp1Ml growth s3un defense exports_percent colony polity2 loggdppc governance_all_mean prio2 physint lnratio)
		compress
		label 
		nonotes
		mtitles("Base Model" "OLS Model" "Random Effects")  
		addnote("Robust standard errors in parentheses." "$*$ p$\leq$ 0.10 $**$ p$\leq$ 0.05, $***$ p$\leq$0.01")
		;		
		#delimit cr
	
	
* Ratio Models w/ year fixed effects

eststo clear
/// Model 1 - Exports
eststo: xtreg F.lnratio c.govtecon##c.exports_percent socgdp1Ml growth post08 s3un defense physint polity2 loggdppc governance_all_mean prio2 lnall colony lnratio i.year, re robust
/// Model 2 - Affinity
eststo: xtreg F.lnratio c.govtecon##c.s3un socgdp1Ml growth post08 defense physint polity2 loggdppc governance_all_mean prio2 lnall c.exports_percent colony lnratio i.year, re robust
/// Model 3 - Defense
eststo: xtreg F.lnratio c.govtecon defense gov_defense socgdp1Ml growth post08 s3un physint polity2 loggdppc governance_all_mean prio2 lnall c.exports_percent colony lnratio i.year, re robust
/// Model 4 - Governance
eststo: xtreg F.lnratio c.govtecon##c.governance_all_mean socgdp1Ml growth post08 s3un defense physint polity2 loggdppc prio2 lnall c.exports_percent colony lnratio i.year, re robust
/// Model 5 - Physical Integrity Rights
eststo: xtreg F.lnratio c.govtecon##c.physint socgdp1Ml growth post08 s3un defense polity2 loggdppc governance_all_mean prio2 lnall c.exports_percent colony lnratio i.year, re robust
/// Model 6 - Development
eststo: xtreg F.lnratio c.govtecon##c.loggdppc socgdp1Ml growth post08 s3un defense physint polity2 governance_all_mean prio2 lnall c.exports_percent colony lnratio i.year, re robust

#delimit ;
	
esttab est1 est2 est3 est4 est5 est6 using table_A5.tex, replace	
		se(3)
		b(3) 
		star(* .10 ** .05 *** .01) 
		wide
		substitute(  )
		nogaps
		keep(govtecon exports_percent s3un defense governance_all_mean physint loggdppc c.govtecon#c.exports_percent c.govtecon#c.s3un gov_defense c.govtecon#c.governance_all_mean c.govtecon#c.physint c.govtecon#c.loggdppc socgdp1Ml growth colony polity2 prio2 post08 lnall lnratio)
		order(govtecon exports_percent s3un defense governance_all_mean physint loggdppc c.govtecon#c.exports_percent c.govtecon#c.s3un gov_defense c.govtecon#c.governance_all_mean c.govtecon#c.physint c.govtecon#c.loggdppc socgdp1Ml growth colony polity2 prio2 post08 lnall lnratio)
		compress
		label 
		nonotes
		mtitles("Exports" "Affinity" "Alliance" "Governance" "Human Rights" "Development") 
		addnote("Robust standard errors in parentheses." "$*$ p$\leq$ 0.10 $**$ p$\leq$ 0.05, $***$ p$\leq$0.01" "Year fixed effects not shown.")
		;		
		#delimit cr
		
		

		
* Recipient Fixed Effects
xtset dyad year
* Ratio Models
eststo clear
reg F.lnratio govtecon socgdp1Ml  growth post08 s3un defense physint polity2 loggdppc governance_all_mean prio2 lnall exports_percent colony lnratio, robust
/// Model 1 - Base Model
eststo: reg F.lnratio govtecon i.ccode2 if e(sample), robust
/// Model 2 - Full Model
eststo: reg F.lnratio govtecon socgdp1Ml  growth s3un defense physint polity2 loggdppc governance_all_mean prio2 lnall exports_percent colony lnratio, robust
/// Model 3 - Full model with recipient fixed effects
eststo: reg F.lnratio govtecon socgdp1Ml  growth s3un defense physint polity2 loggdppc governance_all_mean prio2 lnall exports_percent colony lnratio i.ccode2,  robust

#delimit ;
	
esttab est1 est2 est3 using table_A6.tex, replace	
		se(3)
		b(3) 
		star(* .10 ** .05 *** .01) 
		wide
		substitute(  )
		nogaps
		keep(govtecon  socgdp1Ml growth s3un defense exports_percent colony polity2 loggdppc governance_all_mean prio2 physint lnall lnratio)
		order(govtecon  socgdp1Ml growth s3un defense exports_percent colony polity2 loggdppc governance_all_mean prio2 physint lnall lnratio)
		compress
		label 
		nonotes
		mtitles("Base Model w/FEs" "Full Model" "Recipient FEs")  
		addnote("Robust standard errors in parentheses." "$*$ p$\leq$ 0.10 $**$ p$\leq$ 0.05, $***$ p$\leq$0.01")
		;		
		#delimi cr
		

		
		
		/// Conditional Effects Models with Recipient Fixed Effects

eststo clear
/// Model 1 - Exports
eststo: reg F.lnratio c.govtecon##c.exports_percent socgdp1Ml growth post08 s3un defense physint polity2 loggdppc governance_all_mean prio2 lnall colony lnratio i.ccode2,  robust
/// Model 2 - Affinity
eststo: reg F.lnratio c.govtecon##c.s3un socgdp1Ml growth post08 defense physint polity2 loggdppc governance_all_mean prio2 lnall c.exports_percent colony lnratio i.ccode2,  robust
/// Model 3 - Defense
eststo: reg F.lnratio c.govtecon defense gov_defense socgdp1Ml growth post08 s3un physint polity2 loggdppc governance_all_mean prio2 lnall c.exports_percent colony lnratio i.ccode2,  robust
/// Model 4 - Governance
eststo: reg F.lnratio c.govtecon##c.governance_all_mean socgdp1Ml growth post08 s3un defense physint polity2 loggdppc prio2 lnall c.exports_percent colony lnratio i.ccode2,  robust
/// Model 5 - Physical Integrity Rights
eststo: reg F.lnratio c.govtecon##c.physint socgdp1Ml growth post08 s3un defense polity2 loggdppc governance_all_mean prio2 lnall c.exports_percent colony lnratio i.ccode2,  robust
/// Model 6 - Development
eststo: reg F.lnratio c.govtecon##c.loggdppc socgdp1Ml growth post08 s3un defense physint polity2 governance_all_mean prio2 lnall c.exports_percent colony lnratio i.ccode2,  robust


#delimit ;
	
esttab est1 est2 est3 est4 est5 est6 using table_A7.tex, replace	
		se(3)
		b(3) 
		star(* .10 ** .05 *** .01) 
		wide
		substitute(  )
		nogaps
		keep(govtecon exports_percent s3un defense governance_all_mean physint loggdppc c.govtecon#c.exports_percent c.govtecon#c.s3un gov_defense c.govtecon#c.governance_all_mean c.govtecon#c.physint c.govtecon#c.loggdppc socgdp1Ml growth colony polity2 prio2 post08 lnall lnratio)
		order(govtecon exports_percent s3un defense governance_all_mean physint loggdppc c.govtecon#c.exports_percent c.govtecon#c.s3un gov_defense c.govtecon#c.governance_all_mean c.govtecon#c.physint c.govtecon#c.loggdppc socgdp1Ml growth colony polity2 prio2 post08 lnall lnratio)
		compress
		label 
		nonotes
		mtitles("Exports" "Affinity" "Alliance" "Governance" "Human Rights" "Development") 
		addnote("Robust standard errors in parentheses." "$*$ p$\leq$ 0.10 $**$ p$\leq$ 0.05, $***$ p$\leq$0.01")
		;		
		#delimi cr
		
		
		
	
* NGO Percentage Models
label var percngo "Lagged Dependent Variable"

eststo clear
reg F.percngo govtecon socgdp1Ml  growth post08 s3un defense physint polity2 loggdppc governance_all_mean prio2 lnall exports_percent colony percngo, robust
/// Model 1 - Base Model
eststo: reg F.percngo govtecon if e(sample), robust
/// Model 2 - Full Model
eststo: reg F.percngo govtecon socgdp1Ml  growth s3un defense physint polity2 prio2 lnall exports_percent loggdppc governance_all_mean colony percngo , robust
/// Model 3 - Full model with  random effects
eststo: xtreg F.percngo govtecon socgdp1Ml  growth s3un defense physint polity2 prio2 lnall exports_percent loggdppc governance_all_mean colony percngo , re robust

#delimit ;
	
esttab est1 est2 est3 using table_A8.tex, replace	
		se(3)
		b(3) 
		star(* .10 ** .05 *** .01) 
		wide
		substitute(  )
		nogaps
		order(govtecon socgdp1Ml growth s3un defense exports_percent colony polity2 loggdppc governance_all_mean prio2 physint percngo)
		compress
		label 
		nonotes
		mtitles("Base Model" "OLS Model" "Random Effects")  
		addnote("Robust standard errors in parentheses." "$*$ p$\leq$ 0.10 $**$ p$\leq$ 0.05, $***$ p$\leq$0.01")
		;		
		#delimi cr
		
		
		
		
/// NGO Percentage Models with Conditional Effects

label var percngo "Lagged Dependent Variable"

eststo clear
/// Model 1 - Exports
eststo: xtreg F.percngo c.govtecon##c.exports_percent socgdp1Ml growth post08 s3un defense physint polity2 loggdppc governance_all_mean prio2 lnall colony percngo, re robust
/// Model 2 - Affinity
eststo: xtreg F.percngo c.govtecon##c.s3un socgdp1Ml growth post08 defense physint polity2 loggdppc governance_all_mean prio2 lnall c.exports_percent colony percngo , re robust
/// Model 3 - Defense
eststo: xtreg F.percngo c.govtecon defense gov_defense socgdp1Ml growth post08 s3un physint polity2 loggdppc governance_all_mean prio2 lnall c.exports_percent colony percngo, re robust
/// Model 4 - Governance
eststo: xtreg F.percngo c.govtecon##c.governance_all_mean socgdp1Ml growth post08 s3un defense physint polity2 loggdppc prio2 lnall c.exports_percent colony percngo, re robust
/// Model 5 - Physical Integrity Rights
eststo: xtreg F.percngo c.govtecon##c.physint socgdp1Ml growth post08 s3un defense polity2 loggdppc governance_all_mean prio2 lnall c.exports_percent colony percngo, re robust
/// Model 6 - Development
eststo: xtreg F.percngo c.govtecon##c.loggdppc socgdp1Ml growth post08 s3un defense physint polity2 governance_all_mean prio2 lnall c.exports_percent colony percngo, re robust



#delimit ;
	
esttab est1 est2 est3 est4 est5 est6 using table_A9.tex, replace	
		se(3)
		b(3) 
		star(* .10 ** .05 *** .01) 
		wide
		substitute(  )
		nogaps
		order(govtecon exports_percent s3un defense governance_all_mean physint loggdppc c.govtecon#c.exports_percent c.govtecon#c.s3un gov_defense c.govtecon#c.governance_all_mean c.govtecon#c.physint c.govtecon#c.loggdppc socgdp1Ml growth colony polity2 prio2 post08 lnall percngo)
		compress
		label 
		nonotes
		mtitles("Exports" "Affinity" "Alliance" "Governance" "Human Rights" "Development") 
		addnote("Robust standard errors in parentheses." "$*$ p$\leq$ 0.10 $**$ p$\leq$ 0.05, $***$ p$\leq$0.01")
		;		
		#delimi cr
		
		

		
		
		
* NGO/NGO+GOV Models
label var ngoovergov "Lagged Dependent Variable"

eststo clear
reg F.ngoovergov govtecon socgdp1Ml  growth post08 s3un defense physint polity2 prio2 lnall exports_percent loggdppc governance_all_mean colony ngoovergov, robust
/// Model 1 - Base Model
eststo: reg F.ngoovergov govtecon if e(sample), robust
/// Model 2 - Full Model
eststo: reg F.ngoovergov govtecon socgdp1Ml  growth s3un defense physint polity2 prio2 lnall exports_percent loggdppc governance_all_mean colony ngoovergov, robust
/// Model 3 - Full model with  random effects
eststo: xtreg F.ngoovergov govtecon socgdp1Ml  growth s3un defense physint polity2 prio2 lnall exports_percent loggdppc governance_all_mean colony ngoovergov , re robust

#delimit ;
	
esttab est1 est2 est3 using table_A10.tex, replace	
		se(3)
		b(3) 
		star(* .10 ** .05 *** .01) 
		wide
		substitute(  )
		nogaps
		order(govtecon socgdp1Ml growth s3un defense exports_percent colony polity2 loggdppc governance_all_mean prio2 physint percngo)
		compress
		label 
		nonotes
		mtitles("Base Model" "OLS Model" "Random Effects")  
		addnote("Robust standard errors in parentheses." "$*$ p$\leq$ 0.10 $**$ p$\leq$ 0.05, $***$ p$\leq$0.01")
		;		
		#delimi cr
		
		
		
		
* NGO/NGO+GOV Models and Conditional Effects

label var ngoovergov "Lagged Dependent Variable"
eststo clear
/// Model 1 - Exports
eststo: xtreg F.ngoovergov c.govtecon##c.exports_percent socgdp1Ml growth post08 s3un defense physint polity2 loggdppc governance_all_mean prio2 lnall colony ngoovergov, re robust
/// Model 2 - Affinity
eststo: xtreg F.ngoovergov c.govtecon##c.s3un socgdp1Ml growth post08 defense physint polity2 loggdppc governance_all_mean prio2 lnall c.exports_percent colony ngoovergov, re robust
/// Model 3 - Defense
eststo: xtreg F.ngoovergov c.govtecon defense gov_defense socgdp1Ml growth post08 s3un physint polity2 loggdppc governance_all_mean prio2 lnall c.exports_percent colony ngoovergov, re robust
/// Model 4 - Governance
eststo: xtreg F.ngoovergov c.govtecon##c.governance_all_mean socgdp1Ml growth post08 s3un defense physint polity2 loggdppc prio2 lnall c.exports_percent colony ngoovergov, re robust
/// Model 5 - Physical Integrity Rights
eststo: xtreg F.ngoovergov c.govtecon##c.physint socgdp1Ml growth post08 s3un defense polity2 loggdppc governance_all_mean prio2 lnall c.exports_percent ngoovergov, re robust
/// Model 6 - Development
eststo: xtreg F.ngoovergov c.govtecon##c.loggdppc socgdp1Ml growth post08 s3un defense physint polity2 governance_all_mean prio2 lnall c.exports_percent colony ngoovergov, re robust



#delimit ;
	
esttab est1 est2 est3 est4 est5 est6 using table_A11.tex, replace	
		se(3)
		b(3) 
		star(* .10 ** .05 *** .01) 
		wide
		substitute(  )
		nogaps
mtitles("Exports" "Affinity" "Alliance" "Governance" "Human Rights" "Development") 
		order(govtecon exports_percent s3un defense governance_all_mean physint loggdppc c.govtecon#c.exports_percent c.govtecon#c.s3un gov_defense c.govtecon#c.governance_all_mean c.govtecon#c.physint c.govtecon#c.loggdppc socgdp1Ml growth colony polity2 prio2 post08 lnall ngoovergov)		compress
		label 
		nonotes
		addnote("Robust standard errors in parentheses." "$*$ p$\leq$ 0.10 $**$ p$\leq$ 0.05, $***$ p$\leq$0.01")
		;		
		#delimi cr
		

		
		
* Ratio Models with no lagged dependent variable
eststo clear
reg F.lnratio govtecon socgdp1Ml  growth post08 s3un defense physint polity2 loggdppc governance_all_mean prio2 lnall exports_percent colony , robust
/// Model 1 - Base Model
eststo: reg F.lnratio govtecon if e(sample), robust
/// Model 2 - Full Model
eststo: reg F.lnratio govtecon socgdp1Ml  growth s3un defense physint polity2 loggdppc governance_all_mean prio2 lnall exports_percent colony , robust
/// Model 3 - Full model with  random effects
eststo: xtreg F.lnratio govtecon socgdp1Ml  growth s3un defense physint polity2 loggdppc governance_all_mean prio2 lnall exports_percent colony  , re robust

#delimit ;
	
esttab est1 est2 est3 using table_A12.tex, replace	
		se(3)
		b(3) 
		star(* .10 ** .05 *** .01) 
		wide
		nogaps
		keep(govtecon  socgdp1Ml growth s3un defense exports_percent colony polity2 loggdppc governance_all_mean prio2 physint lnall )
		order(govtecon  socgdp1Ml growth s3un defense exports_percent colony polity2 loggdppc governance_all_mean prio2 physint lnall )
		compress
		label 
		nonotes
		mtitles("Base Model" "OLS Model" "Random Effects")  
		addnote("Robust standard errors in parentheses." "$*$ p$\leq$ 0.10 $**$ p$\leq$ 0.05, $***$ p$\leq$0.01")
		;		
		#delimi cr
		
		
		
* Seemingly Unrelated Regression Models	with no lagged dependent variable	
eststo clear

/// Model 1 - No Fixed Effects
eststo: sureg (F.lnngo   growth  govtecon  colony s3un defense prio2  polity2 loggdppc governance_all_mean socgdp1Ml exports_percent physint lnall) ///
			  (F.lnpublic   growth  govtecon  colony s3un defense prio2  polity2 loggdppc governance_all_mean socgdp1Ml exports_percent physint lnall), corr

/// Model 2 - Fixed Effects
eststo: sureg (F.lnngo  growth  govtecon  colony s3un defense prio2 polity2 loggdppc governance_all_mean socgdp1Ml exports_percent physint lnall i.ccode2) ///
		      (F.lnpublic   growth  govtecon  colony s3un defense prio2  polity2 loggdppc governance_all_mean socgdp1Ml exports_percent physint lnall i.ccode2), corr

			  #delimit ;
	
esttab est1 est2 using table_A13.tex, replace	
		se(3)
		b(3) 
		star(* .10 ** .05 *** .01) 
		wide
		nogaps
		mtitles
		scalars("chi2_bp $\chi^2$" )
		compress
		keep(govtecon  socgdp1Ml growth s3un defense exports_percent colony polity2 governance_all_mean prio2 physint loggdppc lnall )
		order(govtecon  socgdp1Ml growth s3un defense exports_percent colony polity2 governance_all_mean prio2 physint loggdppc lnall )
		label 
		nonotes
		equations(1,2)
		mtitles("No Fixed Effects" "Recipient FE")
		eqlabels("\emph{NGO Aid Equation}" "\emph{Public Sector Aid Equation}")
		addnote("Standard errors in parentheses." "$*$ p$\leq$ 0.10 $**$ p$\leq$ 0.05, $***$ p$\leq$0.01")
		;		
		#delimit cr
		
	
/// Ratio Models with Conditional Effects with no lagged dependent variable
label var gov_def "Donor Government Ideology Score $\times$ Alliance"

eststo clear
/// Model 1 - Exports
eststo: xtreg F.lnratio c.govtecon##c.exports_percent socgdp1Ml growth post08 s3un defense physint polity2 loggdppc governance_all_mean prio2 lnall colony , re robust
/// Model 2 - Affinity
eststo: xtreg F.lnratio c.govtecon##c.s3un socgdp1Ml growth post08 defense physint polity2 loggdppc governance_all_mean prio2 lnall c.exports_percent colony , re robust
/// Model 3 - Defense
eststo: xtreg F.lnratio c.govtecon defense gov_def socgdp1Ml growth post08 s3un physint polity2 loggdppc governance_all_mean prio2 lnall c.exports_percent colony , re robust
/// Model 4 - Governance
eststo: xtreg F.lnratio c.govtecon##c.governance_all_mean socgdp1Ml growth post08 s3un defense physint polity2 loggdppc prio2 lnall c.exports_percent colony , re robust
/// Model 5 - Physical Integrity Rights
eststo: xtreg F.lnratio c.govtecon##c.physint socgdp1Ml growth post08 s3un defense polity2 loggdppc governance_all_mean prio2 lnall c.exports_percent colony , re robust
/// Model 6 - Development
eststo: xtreg F.lnratio c.govtecon##c.loggdppc socgdp1Ml growth post08 s3un defense physint polity2 governance_all_mean prio2 lnall c.exports_percent colony , re robust


#delimit ;
	
esttab est1 est2 est3 est4 est5 est6 using table_A14.tex, replace	
		se(3)
		b(3) 
		star(* .10 ** .05 *** .01) 
		wide
		substitute(  )
		nogaps
		nobaselevels
		noomitted
		compress
		label 
		nonotes
		mtitles("Exports" "Affinity" "Alliance" "Governance" "Human Rights" "Development") 
		order(govtecon exports_percent s3un defense governance_all_mean physint loggdppc c.govtecon#c.exports_percent c.govtecon#c.s3un gov_def c.govtecon#c.governance_all_mean c.govtecon#c.physint c.govtecon#c.loggdppc socgdp1Ml growth colony polity2 prio2 post08 lnall )
		addnote("Robust standard errors in parentheses." "$*$ p$\leq$ 0.10 $**$ p$\leq$ 0.05, $***$ p$\leq$0.01")
		;		
		#delimi cr
		
		
		
		
		
* Ratio Models excluding Polity
eststo clear
reg F.lnratio govtecon socgdp1Ml  growth post08 s3un defense physint  loggdppc governance_all_mean prio2 lnall exports_percent colony lnratio , robust
/// Model 1 - Base Model
eststo: reg F.lnratio govtecon if e(sample), robust
/// Model 2 - Full Model
eststo: reg F.lnratio govtecon socgdp1Ml  growth s3un defense physint  loggdppc governance_all_mean prio2 lnall exports_percent colony lnratio , robust
/// Model 3 - Full model with  random effects
eststo: xtreg F.lnratio govtecon socgdp1Ml  growth s3un defense physint  loggdppc governance_all_mean prio2 lnall exports_percent colony lnratio  , re robust

#delimit ;
	
esttab est1 est2 est3 using table_A15.tex, replace	
		se(3)
		b(3) 
		star(* .10 ** .05 *** .01) 
		wide
		nogaps
		keep(govtecon  socgdp1Ml growth s3un defense exports_percent colony lnratio  loggdppc governance_all_mean prio2 physint lnall )
		order(govtecon  socgdp1Ml growth s3un defense exports_percent colony  loggdppc governance_all_mean prio2 physint lnall )
		compress
		label 
		nonotes
		mtitles("Base Model" "OLS Model" "Random Effects")  
		addnote("Robust standard errors in parentheses." "$*$ p$\leq$ 0.10 $**$ p$\leq$ 0.05, $***$ p$\leq$0.01")
		;		
		#delimi cr
		
		
		
* Seemingly Unrelated Regression Models	excluding Polity
eststo clear

/// Model 1 - No Fixed Effects
eststo: sureg (F.lnngo   growth  govtecon  colony lnratio s3un defense prio2   loggdppc governance_all_mean socgdp1Ml exports_percent physint lnall) ///
			  (F.lnpublic   growth  govtecon  colony lnratio s3un defense prio2   loggdppc governance_all_mean socgdp1Ml exports_percent physint lnall), corr

/// Model 2 - Fixed Effects
eststo: sureg (F.lnngo  growth  govtecon  colony lnratio s3un defense prio2  loggdppc governance_all_mean socgdp1Ml exports_percent physint lnall i.ccode2) ///
		      (F.lnpublic   growth  govtecon  colony lnratio s3un defense prio2   loggdppc governance_all_mean socgdp1Ml exports_percent physint lnall i.ccode2), corr

			  #delimit ;
	
esttab est1 est2 using table_A16.tex, replace	
		se(3)
		b(3) 
		star(* .10 ** .05 *** .01) 
		wide
		nogaps
		mtitles
		scalars("chi2_bp $\chi^2$" )
		compress
		keep(govtecon  socgdp1Ml growth s3un defense exports_percent colony lnratio  governance_all_mean prio2 physint loggdppc lnall )
		order(govtecon  socgdp1Ml growth s3un defense exports_percent colony  governance_all_mean prio2 physint loggdppc lnall )
		label 
		nonotes
		equations(1,2)
		mtitles("No Fixed Effects" "Recipient FE")
		eqlabels("\emph{NGO Aid Equation}" "\emph{Public Sector Aid Equation}")
		addnote("Standard errors in parentheses." "$*$ p$\leq$ 0.10 $**$ p$\leq$ 0.05, $***$ p$\leq$0.01")
		;		
		#delimit cr
		
	
/// Ratio Models with Conditional Effects excluding Polity

eststo clear
/// Model 1 - Exports
eststo: xtreg F.lnratio c.govtecon##c.exports_percent socgdp1Ml growth post08 s3un defense physint  loggdppc governance_all_mean prio2 lnall colony lnratio , re robust
/// Model 2 - Affinity
eststo: xtreg F.lnratio c.govtecon##c.s3un socgdp1Ml growth post08 defense physint  loggdppc governance_all_mean prio2 lnall c.exports_percent colony lnratio , re robust
/// Model 3 - Defense
eststo: xtreg F.lnratio c.govtecon defense gov_defense socgdp1Ml growth post08 s3un physint  loggdppc governance_all_mean prio2 lnall c.exports_percent colony lnratio , re robust
/// Model 4 - Governance
eststo: xtreg F.lnratio c.govtecon##c.governance_all_mean socgdp1Ml growth post08 s3un defense physint  loggdppc prio2 lnall c.exports_percent colony lnratio , re robust
/// Model 5 - Physical Integrity Rights
eststo: xtreg F.lnratio c.govtecon##c.physint socgdp1Ml growth post08 s3un defense  loggdppc governance_all_mean prio2 lnall c.exports_percent colony lnratio , re robust
/// Model 6 - Development
eststo: xtreg F.lnratio c.govtecon##c.loggdppc socgdp1Ml growth post08 s3un defense physint  governance_all_mean prio2 lnall c.exports_percent colony lnratio , re robust


#delimit ;
	
esttab est1 est2 est3 est4 est5 est6 using table_A17.tex, replace	
		se(3)
		b(3) 
		star(* .10 ** .05 *** .01) 
		wide
		substitute(  )
		nogaps
		nobaselevels
		noomitted
		compress
		label 
		nonotes
		mtitles("Exports" "Affinity" "Alliance" "Governance" "Human Rights" "Development") 
		order(govtecon exports_percent s3un defense governance_all_mean physint loggdppc c.govtecon#c.exports_percent c.govtecon#c.s3un gov_defense c.govtecon#c.governance_all_mean c.govtecon#c.physint c.govtecon#c.loggdppc socgdp1Ml growth colony  prio2 post08 lnall )
		addnote("Robust standard errors in parentheses." "$*$ p$\leq$ 0.10 $**$ p$\leq$ 0.05, $***$ p$\leq$0.01")
		;		
		#delimi cr
				
		
log close ngosandaidappendix
